import App from './App'

//检测登录
if (!uni.getStorageSync("token")) {
	uni.navigateTo({
		url: '/pages/login/index'
	})
}

uni.setStorageSync("system",JSON.stringify(uni.getSystemInfoSync())); //缓存系统信息

import uviewPlus from '@/uni_modules/uview-plus'
import CustomTabBar from '@/components/CustomTabbar.vue';

import { createPinia } from 'pinia'
const pinia = createPinia()

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  app.use(uviewPlus);
  app.use(pinia);
  //全局注册自定义 tabBar 组件（组件名：CustomTabBar）
  app.component('CustomTabBar', CustomTabBar);
  return {
    app
  }
}
// #endif